import 'package:flutter/material.dart'; // 引入三方库

// 创建一个列表项组件
class ListViewItem extends StatelessWidget {
  const ListViewItem({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return ListView.builder(
        itemCount: 10,
        // itemExtent: 50,
        itemBuilder: (BuildContext context, int index) {
          return _listItem();
        });
    // return ListView.builder(
    //   itemCount: 100,
    //   itemExtent: 50.0,
    //   itemBuilder: (BuildContext context, int index) {
    //     return ListTile(title: Text("$index"));
    //   },
    // );
  }

  Widget _listItem() {
    return Column(children: [
      Row(children: [
        Image.network(
            'https://ts1.cn.mm.bing.net/th/id/R-C.57384e4c2dd256a755578f00845e60af?rik=uy9%2bvT4%2b7Rur%2fA&riu=http%3a%2f%2fimg06file.tooopen.com%2fimages%2f20171224%2ftooopen_sy_231021357463.jpg&ehk=whpCWn%2byPBvtGi1%2boY1sEBq%2frEUaP6w2N5bnBQsLWdo%3d&risl=&pid=ImgRaw&r=0',
            width: 40,
            height: 40)
      ])
    ]);
  }

// ListTile _tile(String title, String subtitle, IconData icon) {
//   return ListTile(
//     title: Text(
//       title,
//       style: const TextStyle(
//         fontWeight: FontWeight.bold,
//         fontSize: 40,
//       ),
//     ),
//     subtitle: Text(subtitle),
//     leading: Icon(
//       icon,
//       color: Colors.blue[500],
//     ),
//   );
// }
}
